﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PortalParts/Portal.Master" AutoEventWireup="true" CodeBehind="UserInfo.aspx.cs" Inherits="ZHDJ.Web.Portal.Forum.UserInfo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../../Resource/themes/default/css/party.common.css" rel="stylesheet" type="text/css" />
    <link href="../../Resource/themes/default/css/party.portal.css" rel="stylesheet" type="text/css" />
    <link href="../../Resource/themes/default/css/portal.widgets.css" rel="stylesheet" type="text/css" />
    <script src="../../Resource/js/default/jquery.tmpl.min.js"></script>
    <script src="../../Resource/js/knockout/knockout-3.4.0.js"></script>
    <script src="../../Resource/js/jquery/jquery.pagination.js"></script>
    <script>
        var pageSize = 8, isBind = false;

        var paginationPara = {
            num_edge_entries: 1, //边缘页数
            num_display_entries: 4, //主体页数
            callback: pageselectCallback,
            items_per_page: pageSize, //每页显示1项
            prev_text: "上一页",
            next_text: "下一页",
            link_to: "javascript:void(0);"
        }
        var ViewModel = {
            qdate: ko.observableArray(),
            loadContacts: function (pageIndex) {
                $.get("UserInfo.aspx", {
                    PageIndex: pageIndex,
                    PageSize: pageSize,
                    r: (new Date()).getTime()
                },
                function (data) {
                    var ss = eval("(" + data + ")");

                    ViewModel.qdate(eval("(" + data + ")"));
                });
            }
        }

        function initPage() {
            $.get("UserInfo.aspx", {
                DataCount: 1

            },
                function (data) {
                    var totalCount = parseInt(data);
                    if (totalCount == 0) {
                        $("#trnonedata").show();
                        var dd = $("#trnonedata");

                    } 
                        $("#pagination").pagination(totalCount, paginationPara);
                    
                });
        }
        function pageselectCallback(pageIndex, jq) {
            ViewModel.loadContacts(pageIndex);
            if (!isBind) {
                ko.applyBindings(ViewModel);
                isBind = true;
            }

        }

        $(function () {

            initPage();

        });
        function su() {
            window.location.href = window.location.href;
        }


    </script>
    <script id="myTemplate" type="text/x-jquery-tmpl">
        <tr style="text-align:center;height: 48px;line-height: 48px;">
            <td>${Score}</td>
            <td>${ForumTitle}</td>
            <td>${Description}</td>
            <td>${ScoreDate2}</td>
        </tr>                            
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="party-navigation" style="border: none;">
        当前位置：<a href="../../Default.aspx">首页</a> > <a href="BBSIndex.aspx">论坛首页</a> > 我的信息
    </div>
	<div class="bgline"></div>
    <div>
        <f:PageManager ID="PageManager1" runat="server" />

        <f:Form runat="server" ShowBorder="false" ShowHeader="false" ID="Form21">

            <Items>
                <f:ContentPanel runat="server" ID="sdfsdf" ShowBorder="false">
					<div class="mywrap">
						<div class="mywrapleft" style="box-sizing:content-box;">我的信息</div>
					</div>
                    <table cellspacing="0" cellpadding="0" border="0" class="formTable">
                        <tr>
                            <td class="fle">用户ID：</td>
                            <td class="Right">1234567890</td>
                            <td class="fle" colspan="2" rowspan="7">
                                <img runat="server" id="imgPicture" width="160" height="150" style="margin-right: 120px;" src="" />
                            </td>
                        </tr>
                        <tr>
                            <td class="fle">姓名：</td>
                            <td class="Right">
                                <f:Label ID="txtUserName" Width="200px" runat="server"></f:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="fle">头像：</td>
                            <td class="Right">
                                <f:FileUpload runat="server" EmptyText="请选择一张图片" ID="filePhoto" OnFileSelected="filePhoto_FileSelected"
                                    ButtonText="图片" ButtonIcon="ImageAdd" AutoPostBack="true" AcceptFileTypes="image/*" Width="300px">
                                </f:FileUpload>
                            </td>
                        </tr>
                        <tr>
                            <td class="fle">性别：</td>
                            <td class="Right">
                                <f:Label ID="lbSex" Width="200px" runat="server"></f:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="fle">所属组织：</td>
                            <td class="Right">
                                <f:Label ID="lbBranchName" runat="server"></f:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="fle">论坛积分：</td>
                            <td class="Right">
                                <f:Label ID="lbScore" runat="server"></f:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="fle">其它信息：</td>
                            <td class="Right"><f:Label ID="lbPostNum" LabelAlign="Right" LabelWidth="60px"  Label="发帖数：" runat="server">
                                </f:Label>&nbsp;&nbsp;<f:Label ID="lbReplayNum" LabelAlign="Right" LabelWidth="60px" Label="回帖数："  runat="server">
                                </f:Label>&nbsp;&nbsp;<f:Label ID="lbBestNum" LabelAlign="Right"  LabelWidth="60px" Label="加精帖："  runat="server">
                                </f:Label>
                            </td>                            
                        </tr>
                    </table>
					<div style="width: 100px;margin: 20px auto;height:auto;" class="mysubtn">
						<f:Button ID="Button1" ValidateForms="Form21" OnClick="btnSave_Click" CssClass="mybtn" runat="server" Text="提交"></f:Button>
					</div>
                    <f:HiddenField ID="hdImageId" runat="server"></f:HiddenField>                
                </f:ContentPanel>
            </Items>
        </f:Form>
        <div>
			<div class="mywrap">
				<div class="mywrapleft">个人论坛积分</div>
			</div>
            <table cellspacing="0" cellpadding="0" border="0" class="formTable zebra" >
                <tr style="text-align:center;height: 48px;line-height: 48px;">
                    <td>分数</td>
                    <td>帖子名称</td>
                    <td>加分类型</td>
                    <td>加分时间</td>
                </tr>

                         <!-- ko template: { name: 'myTemplate', foreach: qdate} -->
            <!-- /ko -->
                <tr id="trnonedata" style="display:none">
                    <td style="text-align: center;" colspan="4">无数据</td>
                </tr>
            </table>
            <div class="pagination">
				<div id="pagination"></div>
			</div>
        </div>
    </div>
</asp:Content>
